<template>
	<div :class="[prefixCls+'-exception']">
        <div :class="[prefixCls+'-exception-img-'+type]"></div>
        <div :class="[prefixCls+'-exception-content']">
			<h2>{{type}}</h2>
			<div :class="[prefixCls+'-exception-content-desc']">
				{{desc[type]}}
			</div>
			<mj-button type="primary" :to="redirect">{{backText}}</mj-button>
		</div>
	</div>
</template>

<script>
import { prefixCls } from '../prefix'
import './exception.css'

export default {
    name: `${prefixCls}Exception`,
    props:{
    	type: {
    		type: String,
    	},
    	backText: {
    		type: String,
    		default: '返回首页'
    	},
    	redirect: {
    		type: String,
    		default: '/'
    	}
    },
    data(){
        return {
            prefixCls: prefixCls,
            desc:{
            	403:'抱歉，你无权访问该页面',
            	404:'抱歉，你访问的页面不存在',
            	500:'抱歉，服务器出错了',
            }
        }
    },
}
</script>